#ifndef _NUM_GRAPH_H_
#define _NUM_GRAPH_H_

#include "math/vec2.h"
#include "micropather.h"
#include <vector>

namespace num
{
typedef unsigned int GRAPH_NODE_ID;
class Graph: public micropather::Graph
{
public:
	Graph();
	~Graph();
	void					AddNode(GRAPH_NODE_ID NodeID, const math::Vec2& Pos);
	bool					AddEdge(GRAPH_NODE_ID pA, GRAPH_NODE_ID pB);
	bool					EdgeExists(GRAPH_NODE_ID pFrom, GRAPH_NODE_ID pTo);
	bool					FindPath(GRAPH_NODE_ID pFrom, GRAPH_NODE_ID pTo, std::vector<GRAPH_NODE_ID>& Path);
	void					Reset();
protected:
	virtual float	LeastCostEstimate( void* stateStart, void* stateEnd );
	virtual void	AdjacentCost( void* state, std::vector< micropather::StateCost > *adjacent );

	struct					GraphNode
	{
		math::Vec2						Pos;
		GRAPH_NODE_ID					ID;
	};
	struct					GraphEdge
	{
		GRAPH_NODE_ID					From, To;
		
	};
	std::vector<GraphNode*>				m_Nodes;
	std::vector<GraphEdge*>				m_Edges;

	GraphNode*							GetNode(GRAPH_NODE_ID ID);

	// pathing info
	micropather::MicroPather*		m_pPather;
	std::vector<void*>				m_Path;
	float							m_TotalCost;

};
} // namespace num

#endif // _NUM_GRAPH_H_